﻿Imports DTO

Public Class DAMonthly
    Inherits DataProvider

    ''' <summary>
    ''' Config server name
    ''' </summary>
    ''' <param name="serverName"></param>
    ''' <remarks></remarks>
    Shared Sub ConfigServerName(ByVal serverName As String)

        ' call constructor base class
        ConfigServer(serverName)

    End Sub

    ''' <summary>
    ''' Get monthly by organizatonal No
    ''' </summary>
    ''' <param name="organNo"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function GetMonthly(ByVal organNo As String) As DataTable

        Return Query("GetMonthly", New String() {"@organNo"}, New Object() {organNo})

    End Function

    ''' <summary>
    ''' update monthly
    ''' </summary>
    ''' <param name="dtoMonthly"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function DeleteAllMonthly(ByVal organNo As String) As Integer

        Return Update("DeleteAllMonthly", New String() {"@organNo"}, New Object() {organNo})

    End Function

    ''' <summary>
    ''' Add monthly
    ''' </summary>
    ''' <param name="dtoMonthly"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Shared Function AddMonthly(ByVal dtoMonthly As DTOMonthly) As Integer

        Dim params As String() = New String() {"@organNo", "@exFrom", "@exto", "@cutOffDate", "@unitMinute", "@createDate", "@updateDate"}

        Dim values As Object() = New Object() {dtoMonthly.OrganNoProperty, dtoMonthly.ExFromProperty,
                                               dtoMonthly.ExToProperty, dtoMonthly.CutOffProperty,
                                               dtoMonthly.UnitMinuteProperty, dtoMonthly.CreateDateProperty, dtoMonthly.UpdateDateProperty}

        Return Update("AddMonthly", params, values)

    End Function

End Class
